import request from "@/libs/request";

const basePath = '/appcloud-deploy-api' ;


export const apiUrls = {
	createFile : basePath + '/api/deployContent/createFile',
	deleteFile : basePath + '/api/deployContent/deleteFile',
	getDeployContent : basePath + '/api/deployContent/getDeployContent',
	getDockerPath : basePath + '/api/deployContent/getDockerPath',
	updateConfFile : basePath + '/api/deployContent/updateConfFile',
	updateDeployFile : basePath + '/api/deployContent/updateDeployFile',
}


// 创建文件或文件夹
export async function createFile(params){
	return request( apiUrls.createFile , {
      method:'POST',
      body:params
  })
}


// 删除文件 文件夹
export async function deleteFile(params){
	return request( apiUrls.deleteFile , {
      method:'POST',
      body:params
  })
}


// 根据路径获取发布内容
export async function getDeployContent(params){
	return request( apiUrls.getDeployContent , {
      method:'POST',
      body:params
  })
}


// 获取容器路径（测试专用）
export async function getDockerPath(params){
	return request( apiUrls.getDockerPath , {
      method:'POST',
      body:params
  })
}


//修改配置文件
export async function updateConfFile(params){
	return request( apiUrls.updateConfFile , {
      method:'POST',
      body:params
  })
}


//修改发布内容文件
export async function updateDeployFile(params){
	return request( apiUrls.updateDeployFile , {
      method:'POST',
      body:params
  })
}